package cqrtplm.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.github.pagehelper.PageInfo;
import cqrtplm.constant.RouteConstant;
import cqrtplm.dto.query.DspfDemandDevplanQueryDTO;
import cqrtplm.dto.query.RtCfgDemandOrdersQueryDTO;
import cqrtplm.entity.DspfDemandDevplanDO;
import cqrtplm.entity.RtCfgDemandOrders;
import cqrtplm.service.IRtCfgDemandOrdersService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 需求状态Controller
 *
 * @author 江小雄
 * @date 2025-06-26
 */
@RestController
@RequestMapping(RouteConstant.DEMANDORDERS + "v1")
public class RtCfgDemandOrdersController
{
    @Autowired
    private IRtCfgDemandOrdersService rtCfgDemandOrdersService;

//    /**
//     * 查询需求状态列表
//     */
//    @PreAuthorize("@ss.hasPermi('system:demandOrders:list')")
//    @GetMapping("/list")
//    public TableDataInfo list(RtCfgDemandOrders rtCfgDemandOrders)
//    {
//        startPage();
//        List<RtCfgDemandOrders> list = rtCfgDemandOrdersService.selectRtCfgDemandOrdersList(rtCfgDemandOrders);
//        return getDataTable(list);
//    }

    /**
     * 查询需求状态列表
     */
    @GetMapping("/list")
    public PageInfo<RtCfgDemandOrders> list(RtCfgDemandOrdersQueryDTO queryDTO) {

        return rtCfgDemandOrdersService.listPage(queryDTO, queryDTO.getPageNum()==null ? 1: queryDTO.getPageNum(), queryDTO.getPageSize()==null ? 10: queryDTO.getPageSize());
    }

//    /**
//     * 导出需求状态列表
//     */
//    @PreAuthorize("@ss.hasPermi('system:demandOrders:export')")
//    @Log(title = "需求状态", businessType = BusinessType.EXPORT)
//    @PostMapping("/export")
//    public void export(HttpServletResponse response, RtCfgDemandOrders rtCfgDemandOrders)
//    {
//        List<RtCfgDemandOrders> list = rtCfgDemandOrdersService.selectRtCfgDemandOrdersList(rtCfgDemandOrders);
//        ExcelUtil<RtCfgDemandOrders> util = new ExcelUtil<RtCfgDemandOrders>(RtCfgDemandOrders.class);
//        util.exportExcel(response, list, "需求状态数据");
//    }
//
//    /**
//     * 获取需求状态详细信息
//     */
//    @PreAuthorize("@ss.hasPermi('system:demandOrders:query')")
//    @GetMapping(value = "/{category}")
//    public AjaxResult getInfo(@PathVariable("category") String category)
//    {
//        return success(rtCfgDemandOrdersService.selectRtCfgDemandOrdersByCategory(category));
//    }
//
//    /**
//     * 新增需求状态
//     */
//    @PreAuthorize("@ss.hasPermi('system:demandOrders:add')")
//    @Log(title = "需求状态", businessType = BusinessType.INSERT)
//    @PostMapping
//    public AjaxResult add(@RequestBody RtCfgDemandOrders rtCfgDemandOrders)
//    {
//        return toAjax(rtCfgDemandOrdersService.insertRtCfgDemandOrders(rtCfgDemandOrders));
//    }
//
//    /**
//     * 修改需求状态
//     */
//    @PreAuthorize("@ss.hasPermi('system:demandOrders:edit')")
//    @Log(title = "需求状态", businessType = BusinessType.UPDATE)
//    @PutMapping
//    public AjaxResult edit(@RequestBody RtCfgDemandOrders rtCfgDemandOrders)
//    {
//        return toAjax(rtCfgDemandOrdersService.updateRtCfgDemandOrders(rtCfgDemandOrders));
//    }
//
//    /**
//     * 删除需求状态
//     */
//    @PreAuthorize("@ss.hasPermi('system:demandOrders:remove')")
//    @Log(title = "需求状态", businessType = BusinessType.DELETE)
//	@DeleteMapping("/{categorys}")
//    public AjaxResult remove(@PathVariable String[] categorys)
//    {
//        return toAjax(rtCfgDemandOrdersService.deleteRtCfgDemandOrdersByCategorys(categorys));
//    }
}
